#ifndef STATUS_TYPE_MANAGER
#define STATUS_TYPE_MANAGER

#include "statustypegroup.h"
#include "statustype.h"

#include <QList>
#include <QMap>


class QString;
class QIcon;
class Status;
class StatusTypeData;

/**
 * This singleton class contains instances of StatusTypeData for each value of StatusType enum.
 **/
class StatusTypeManager
{
public:
    static StatusTypeManager * instance();

    /**
     * Returns StatusType enum value with given name. If no valid enum value is found, StatusTypeOffline
     * is returned.
     */
    StatusType fromName(const QString &name);

    /**
     * Returns StatusTypeData instance for given StatusType enum value. If no valid StatusTypeData instance
     * is found, valud for StatusTypeOffline is returned.
     */
    const StatusTypeData statusTypeData(const StatusType statusType);

    /**
     * Returns icon for given status.
     */
    QIcon statusIcon(const Status &status);

private:
    StatusTypeManager();
    ~StatusTypeManager();

private:
    Q_DISABLE_COPY(StatusTypeManager)

    static StatusTypeManager *m_instance;

    QMap<StatusType, StatusTypeData> m_statusTypes;
};

#endif // STATUS_TYPE_MANAGER
